xl: fix incorrect display of illegal option character
authorAndre Przywara <andre.przywara@amd.com>
Fri, 28 Jan 2011 17:56:00 +0000 (17:56 +0000)
committerAndre Przywara <andre.przywara@amd.com>
Fri, 28 Jan 2011 17:56:00 +0000 (17:56 +0000)
commitc72092776211365cea1d24f93a3db9143e0b9491
treed668d740b0a60a394892465f2a45c9271a96801c
parent8da70699aeed0137d1df247d878f91a1320fac8c
xl: fix incorrect display of illegal option character

according to the getopt(3) manpage (and to my testing) getopt returns
'?' if an unknown option character is found and stores the insulting
character in optopt.
This patch fixes the broken output in such a situation:

root@dosorca:/data/images# xl vcpu-list -j
option `?' not supported.
Name                  ID  VCPU   CPU State   Time(s) CPU Affinity
Domain-0               0     0    0   -b-     193.1  any cpu

turns into:

root@dosorca:/data/images# xl vcpu-list -j
option `j' not supported.
Name                  ID  VCPU   CPU State   Time(s) CPU Affinity
Domain-0               0     0    0   -b-     193.1  any cpu

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c